import Vue from 'vue'
import Router from 'vue-router'
import login from "../components/login"
import index from "../components/index"
import error from "../components/error"
import updatepwd from "../components/personal/updatepwd"
import teaAllInfo from "../components/information/teaAllInfo"
import compAllInfo from "../components/information/compAllInfo"
import datadriver from "../components/work/datadriver"
import portalInfoRelease from "../components/work/portalInfoRelease"
import myPortalInfoRelease from "../components/work/myPortalInfoRelease"
import createUser from "../components/work/createUser"
import jquery from 'jquery'
Vue.use(Router)

function route (path, file, name, children) {
  return {
    exact: true,
    path,
    name,
    children,
    component: () => import('../components' + file)
  }
}


export default new Router({
  routes: [
    {
      path: '/login',
      name: 'login',
      component: login,
      meta: {
        keepAlive: false
      }

    }
    , {
      path: '/index',
      name: 'index',
      component: index,
      meta: {
        keepAlive: true
      }
    }
    , {
      path: '/error',
      name: 'error',
      component: error
    }

    , {
      path: '/updatepwd',
      name: 'updatepwd',
      component: updatepwd,
      meta: {
        keepAlive: true
      }
    }

    , {
      path: '/teaAllInfo',
      name: 'teaAllInfo',
      component: teaAllInfo,
      meta: {
        keepAlive: true
      }
    }
    , {
      path: '/compAllInfo',
      name: 'compAllInfo',
      component: compAllInfo,
      meta: {
        keepAlive: true
      }
    }

    , {
      path: '/datadriver',
      name: 'datadriver',
      component: datadriver,
      meta: {
        keepAlive: true
      }
    }

    , {
      path: '/portalInfoRelease',
      name: 'portalInfoRelease',
      component: portalInfoRelease,
      meta: {
        keepAlive: true
      }
    }

    , {
      path: '/myPortalInfoRelease',
      name: 'myPortalInfoRelease',
      component: myPortalInfoRelease,
      meta: {
        keepAlive: true
      }
    }
    , {
      path: '/createUser',
      name: 'createUser',
      component: createUser,
      meta: {
        keepAlive: true
      }
    }

  ]
})
